package com.lmb.service.impl;

import com.lmb.bean.PublicServices;
import com.lmb.mapper.PublicServicesDao;
import com.lmb.service.PublicServicesService;
import com.lmb.util.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PublicServicesServiceImpl implements PublicServicesService {
    @Autowired
    PublicServicesDao publicServicesDao;

    @Override
    public PublicServices add(PublicServices publicServices) {
        publicServicesDao.add(publicServices);
        PublicServices result=publicServicesDao.one(publicServices.getService_id());
        return result;
    }

    @Override
    public PublicServices edit(PublicServices publicServices) {
        publicServicesDao.edit(publicServices);
        PublicServices result=publicServicesDao.one(publicServices.getService_id());
        return result;
    }

    @Override
    public int del(Integer id) {
        return publicServicesDao.del(id);
    }

    @Override
    public PublicServices one(Integer id) {
        return publicServicesDao.one(id);
    }

    @Override
    public List<PublicServices> all(PublicServices publicServices) {

        return publicServicesDao.all(publicServices);
    }

    @Override
    public void page(Page page, PublicServices publicServices) {
        int count= publicServicesDao.pageCount(publicServices);
        Object data= publicServicesDao.page(page, publicServices);
        page.setCount(count);
        page.setData(data);
    }
    
}
